package com.mybatis.jpa.context;

import java.util.Map;

/**
 * 数据权限上下文
 */
public class DataPermissonContext {
    private static  ThreadLocal<Map<String,String>> dataPermisson = new ThreadLocal();

    /**
     * 设置 dataPermissonMap
     * @param dataPermissonMap dataPermissonMap
     */
    public static  void setDataPermissonMap(Map<String,String> dataPermissonMap)
    {
        dataPermisson.set(dataPermissonMap);
    }

    /**
     * 获取 DataPermissonMap
     * key 数据权限code value 数据权限ids 可以拿过去直接in
     * @return DataPermissonMap
     */
    public static Map<String,String> getDataPermissonMap(){
        return dataPermisson.get();
    }
}
